<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="statisticServicesPeriod" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="ru/apertum/qsystem/reports/templates/i3-label-rep" uuid="4bdbc39e-f3a1-463c-bfbc-10a01307491f">
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="sd" class="java.util.Date"/>
	<parameter name="ed" class="java.util.Date"/>
	<parameter name="ed1" class="java.util.Date"/>
	<queryString>
		<![CDATA[SELECT
   sr.name as user_name,
   count(*) as client_count,
   round(sum(st.user_work_period)/count(*)) as work_avg,
   max(st.user_work_period) as work_max,
   min(st.user_work_period) as work_min
FROM
   users sr JOIN statistic st ON   st.state_in<>0 AND    sr.id = st.user_id
WHERE
   st.client_stand_time >= $P{sd} and
   st.client_stand_time <= $P{ed1}
GROUP BY
   sr.name]]>
	</queryString>
	<field name="user_name" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="client_count" class="java.lang.Integer">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="work_avg" class="java.lang.Integer">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="work_max" class="java.lang.Integer">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="work_min" class="java.lang.Integer">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<title>
		<band height="65">
			<line>
				<reportElement uuid="e513ede9-fa73-4ca8-8d1b-8f5f3c3ca489" x="0" y="8" width="555" height="1"/>
			</line>
			<line>
				<reportElement uuid="c314eec4-b4f6-4c6b-b167-9a062836985f" positionType="FixRelativeToBottom" x="0" y="61" width="555" height="1"/>
			</line>
			<textField pattern="">
				<reportElement uuid="69053225-d767-4835-b619-a4e0ef77525c" x="1" y="35" width="551" height="24"/>
				<textElement textAlignment="Center">
					<font fontName="SansSerif" size="18" isBold="true" isUnderline="false" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{from_date}+" " + (new java.text.SimpleDateFormat("dd.MM.yyyy")).format($P{sd}) + " "+$R{to_date}+" " + (new java.text.SimpleDateFormat("dd.MM.yyyy")).format($P{ed})]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="ce822d8a-3151-422d-9ec3-fe8adb885999" x="1" y="9" width="554" height="26"/>
				<textElement textAlignment="Center">
					<font size="18" isBold="true" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{statistic_period_users}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band/>
	</pageHeader>
	<columnHeader>
		<band height="101">
			<textField>
				<reportElement uuid="35c5e0a6-f295-41ec-bd12-fd642a4278bc" mode="Opaque" x="1" y="0" width="362" height="101" forecolor="#FFFFFF" backcolor="#999999"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
					<paragraph lineSpacing="Single" lineSpacingSize="5.0"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{user}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="131dcca3-d19d-4902-97f0-ee91699c152e" mode="Opaque" x="365" y="0" width="45" height="101" forecolor="#FFFFFF" backcolor="#999999"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="Left">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{client_count}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="ba56bc2e-7ae7-4291-8a49-6632fbdc88e2" mode="Opaque" x="412" y="0" width="45" height="101" forecolor="#FFFFFF" backcolor="#999999"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="Left">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8_R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{work_avg}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="ab9cb70e-e424-4095-a4c3-d5e02abd49e8" mode="Opaque" x="459" y="0" width="46" height="101" forecolor="#FFFFFF" backcolor="#999999"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="Left">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8_R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{work_max}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="98ca4f89-0e3a-4692-a225-cf78dc85a929" mode="Opaque" x="507" y="0" width="48" height="101" forecolor="#FFFFFF" backcolor="#999999"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" rotation="Left">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{work_min}]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<detail>
		<band height="21">
			<textField isStretchWithOverflow="true">
				<reportElement uuid="3c3197de-aaa7-4aec-bc85-b25dd43447b2" mode="Opaque" x="412" y="0" width="47" height="20" backcolor="#CCCCFF"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{work_avg}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="55b8e07c-1aff-4dca-82e8-a81970e1626c" mode="Opaque" x="459" y="0" width="48" height="20" backcolor="#F4F4FF"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{work_max}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="80f3bb4c-4a4f-4991-8737-5038c3b4b67a" mode="Opaque" x="507" y="0" width="48" height="20" backcolor="#CCCCFF"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{work_min}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="87d33a3c-6268-4c4a-a92c-989355b7882b" mode="Opaque" x="365" y="0" width="47" height="20" backcolor="#F4F4FF"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{client_count}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement uuid="02d15803-d4bb-4d74-bd16-94727320a05e" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="365" height="20" backcolor="#CCCCFF"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font size="12" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{user_name}]]></textFieldExpression>
			</textField>
			<line>
				<reportElement uuid="02397ab1-cd80-49a0-884e-c50fae1cda21" x="0" y="20" width="555" height="1"/>
			</line>
		</band>
	</detail>
	<pageFooter>
		<band height="21">
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
				<reportElement uuid="49534e21-81d4-491c-b2b5-bf58d9c6038f" key="textField" x="516" y="2" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement uuid="f8d77eca-b8e4-47a4-b086-d7a1dd05885e" key="textField" x="296" y="2" width="216" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right">
					<font size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{page}+" " + $V{PAGE_NUMBER} + " "+$R{from}+" "]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false">
				<reportElement uuid="7226f976-0232-4cbd-8642-a4219588939c" key="textField" x="1" y="2" width="295" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font size="10" pdfFontName="tahoma.ttf" pdfEncoding="KOI8-R" isPdfEmbedded="true"/>
				</textElement>
				<textFieldExpression><![CDATA[new Date()]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
</jasperReport>
